#include <iostream>

using namespace std;

struct Data {
  int data1;

  Data(int data1) : data1(data1) {}
  Data() : data1(0) {}
};

class Plus {
public:
  Data add(Data *a, Data *b) {
    Data tmp;
    tmp.data1 = a->data1 + b->data1;
    return tmp;
  }

  Data operator()(Data *a, Data *b) { return add(a, b); }
};

int main() {
  auto *ptr1 = new Data(10);
  auto *ptr2 = new Data(20);
  Plus p;
  Data d3 = p(ptr1, ptr2);
  cout << "d3.data1 = " << d3.data1 << endl;

  return 0;
}